﻿using System;
using System.Collections.Generic;
using System.Text;

namespace SpiderPlatform.Entity
{
    public class RanchProduct
    {
        public string id { get; set; }

        public string store_id { get; set; }

        public string price { get; set; }

        public string upc { get; set; }

        public string name { get; set; }

        public string description { get; set; }

        public string[] department_id { get; set; }

        public string identifier { get; set; }

        public RanchImageInfo[] images { get; set; }

        public int quantity_on_hand { get; set; }

        public string imageInfo
        {
            get
            {
                var temp = string.Empty;
                if (images != null)
                {
                    foreach (var item in images)
                    {
                        temp += $"https://images.freshop.com/{item.identifier}_large.png|";
                    }
                }
                return temp.TrimEnd(',');
            }
        }

        public string link
        {
            get
            {
                return "https://www.99ranch.com/shop#!/?id=" + id;
            }
        }
    }

    public class RanchImageInfo {
        public int sequence { get; set; }
        public string identifier { get; set; }
    }
    public class RanchProductResult
    {
        public int total { get; set; }

        public RanchProduct[] items { get; set; }
    }
}
